package com.zygh.dlqwservice.module.controller.app;

import com.zygh.dlqwservice.common.anno.ViLog;
import com.zygh.dlqwservice.common.domain.ResultBeans;
import com.zygh.dlqwservice.common.domain.ResultUtils;
import com.zygh.dlqwservice.constant.SwaggerTagConst;
import com.zygh.dlqwservice.module.entity.Gps;
import com.zygh.dlqwservice.module.service.IGpsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lee
 */
@RestController
@RequestMapping("/gps")
@Api(tags = {SwaggerTagConst.Admin.MANAGER_APP_GPS})
public class AppGpsController {
    @Resource
    private IGpsService iGpsService;

    @PostMapping("/get")
    @ApiOperation("获取gps")
    @ViLog(logType = "1", module = SwaggerTagConst.Admin.MANAGER_APP_GPS, content = "获取gps")
    public ResultBeans getGps(@RequestBody Gps gps) {
        boolean save = iGpsService.save(gps);
        return save ? ResultUtils.resultBeansSuccess("获取gps成功") : ResultUtils.resultBeansError("获取gps失败");
    }
}
